﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true"
    CodeBehind="MeuCarrinho.aspx.cs" Inherits="MakeIT.Deo.Apresentacao.MeuCarrinho" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat='server'>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            Or&ccedil;amento no Carrinho:
            <hr />
            <asp:Panel ID="PanelOrcamentoVazio" runat="server" Visible="false">
                Carrinho vazio.
            </asp:Panel>
            <asp:Panel ID="PanelOrcamento" runat="server" Visible="false" HorizontalAlign="Left">
                Or&ccedil;amento n&uacute;mero:
                <asp:TextBox ID="TextBoxID" runat="server" Enabled="False" Columns="5"></asp:TextBox>
                - Iniciado em:
                <asp:TextBox ID="TextBoxData" runat="server" Enabled="False" Columns="10"></asp:TextBox>
                &nbsp;Finalizar Orcamento:
                <asp:ImageButton ID="imbFinalizar" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterPage/shopping_cart_accept.png"
                    OnClick="imbFinalizar_Click" ToolTip="Clique neste botão para enviar e finalizar este orçamento."
                    ValidationGroup="salvar" />
                <hr />
                <asp:GridView ID="GridViewItens" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridViewItens_RowDataBound"
                    CellPadding="2" ForeColor="#333333" GridLines="None" CellSpacing="2" Enabled="true">
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Size="Small" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <%# Container.DataItemIndex+1 %>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Item</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="IdProduto" HeaderText="Código" />
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Produto</HeaderTemplate>
                            <ItemStyle Font-Size="8pt" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Tipo</HeaderTemplate>
                            <ItemStyle Font-Size="8pt" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:TextBox ID="tbQtd" runat="server" Columns="10" Text='<%# DataBinder.Eval(Container.DataItem, "Quantidade").ToString()%>'> </asp:TextBox>
                                <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" ClearTextOnInvalid="True"
                                    ErrorTooltipEnabled="true" AutoComplete="False" ClearMaskOnLostFocus="True" InputDirection="RightToLeft"
                                    Mask="999,999,999" MaskType="Number" PromptCharacter="_" TargetControlID="tbQtd">
                                </asp:MaskedEditExtender>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="tbQtd"
                                    ErrorMessage="Favor informar uma quantidade maior que zero, obrigado." Display="None"
                                    MinimumValue="1" MaximumValue="999999999" Type="Integer" ValidationGroup="salvar"></asp:RangeValidator>
                                <asp:RequiredFieldValidator ControlToValidate="tbQtd" ErrorMessage="Favor informar a quantidade, obrigado."
                                    ID="rfvTbQtd" Display="None" runat="server" Text="text" ToolTip="tooltip" ValidationGroup="salvar"></asp:RequiredFieldValidator>
                                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="rfvTbQtd">
                                </asp:ValidatorCalloutExtender>
                                <asp:ValidatorCalloutExtender ID="revDigit1Ext" runat="server" TargetControlID="RangeValidator1">
                                </asp:ValidatorCalloutExtender>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Quantidade</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Unidade</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Refer&egrave;ncia</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Embalagem</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Caixa</HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="imgbRemove" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterPage/shopping_cart_remove.png"
                                    ToolTip="Remove este produto da lista" OnClick="imgbRemove_Click" CommandArgument='<%#Eval("IdOrcamentoItem")%>' />
                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Confirma a exclusão deste item do carrinho?"
                                    Enabled="True" TargetControlID="imgbRemove">
                                </asp:ConfirmButtonExtender>
                            </ItemTemplate>
                            <HeaderTemplate>
                                Remover</HeaderTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Font-Size="Small" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>
                <asp:Button ID="ButtonSalvar" runat="server" Text="Salvar" OnClick="ButtonSalvar_Click"
                    ValidationGroup="salvar" /><br />
                <p style="font-size: smaller; color: Blue">
                    *Ap&oacute;s terminar de colocar os produtos em seu carrinho, clique no bot&atilde;o
                    Finalizar para enviar seu pedido de or&ccedil;amento. Obrigado.
                </p>
            </asp:Panel>
            <asp:Panel ID="PanelOK" runat="server" Visible="false">
                <div style="filter: alpha(opacity=50); opacity: .5; width: 100%; height: 100%; vertical-align: middle;
                    text-align: center;">
                    <table cellpadding="0" cellspacing="0" width="100%" style="height: 100%; margin: 0 0 0 0;">
                        <tr>
                            <td style="vertical-align: middle; text-align: center;">
                                <center>
                                    <asp:Panel ID="Panel1" runat="server" Width="500" Height="250" BackColor="#3333CC">
                                        <div style="width: 500px; height: 250px; vertical-align: middle; text-align: center;
                                            font-size: large; color: White;">
                                            <br />
                                            <br />
                                            Seu pedido de or&ccedil;amento foi enviado com sucesso.<br />
                                            Em breve responderemos ao seu contato.<br />
                                            <br />
                                            Obrigado!<br />
                                            <br />
                                            <br />
                                            <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/Default.aspx" ForeColor="White">Voltar para a P&aacute;gina Principal</asp:LinkButton>
                                        </div>
                                    </asp:Panel>
                                </center>
                                <asp:RoundedCornersExtender ID="RoundedCornersExtender2" runat="server" TargetControlID="Panel1"
                                    BorderColor="White" Radius="8">
                                </asp:RoundedCornersExtender>
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
